//---------------------------------------------------------------------------

#ifndef t_normaljobformH
#define t_normaljobformH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ComCtrls.hpp>
#include <Vcl.Grids.hpp>
//---------------------------------------------------------------------------
class TNormalJobForm : public TForm
{
__published:	// IDE-managed Components
   TButton *ButtonOk;
   TPageControl *PageControl1;
   TTabSheet *TabSheet1;
   TLabel *Label1;
   TLabel *Label2;
   TLabel *Label4;
   TLabel *Label5;
   TLabel *Label6;
   TLabel *Label7;
   TLabel *Label8;
   TLabel *Label9;
   TLabel *Label10;
   TLabel *Label12;
   TLabel *Label11;
   TLabel *Label13;
   TLabel *Label15;
   TLabel *Label16;
   TLabel *Label14;
   TLabel *Label17;
   TLabel *Label18;
   TLabel *Label19;
   TLabel *Label20;
   TLabel *Label21;
   TLabel *Label22;
   TEdit *EditName;
   TEdit *EditCommand;
   TEdit *EditStatus;
   TEdit *EditStartTime;
   TEdit *EditEndTime;
   TEdit *EditConditionFile;
   TEdit *EditRestoreCommand;
   TEdit *EditRestoreStatus;
   TCheckBox *CheckBoxCondNot;
   TEdit *EditAdditionalLog;
   TEdit *EditSpecialDate;
   TEdit *EditElapse;
   TEdit *EditPid;
   TEdit *EditJobTrigger;
   TEdit *EditPartitionFile;
   TCheckBox *CheckBoxExclusive;
   TEdit *EditAlarmTimeType;
   TEdit *EditAlarmTime;
   TEdit *EditPriority;
   TEdit *EditAutoRerun;
   TEdit *EditServerId;
   TCheckBox *CheckBoxAnchor;
   TEdit *EditParallelJobNumber;
   TEdit *EditTag;
   TEdit *EditRunningGroup;
   TTabSheet *TabSheet2;
   TLabel *Label3;
   TLabel *Label23;
   TLabel *Label24;
   TMemo *MemoDescription;
   TMemo *MemoResourceList;
   TMemo *MemoExternJobList;
   TTabSheet *TabSheet3;
   TStringGrid *PartGrid;
   TButton *ButtonViewLog;
   TButton *ButtonViewAdditionalLog;
   TButton *ButtonSkip;
   TButton *ButtonRestore;
   TButton *ButtonRerun;
   TButton *ButtonStop;
   TButton *ButtonSort;
   TComboBox *ComboBoxSort;
   TButton *ButtonViewRestoreLog;
   TTabSheet *TabSheet4;
   TLabel *Label25;
   TLabel *Label26;
   TLabel *Label27;
   TLabel *Label28;
   TLabel *Label29;
   TEdit *EditLoopStartTime;
   TEdit *EditLoopEndTime;
   TEdit *EditLoopInterval;
   TEdit *EditLoopConditionVariable;
   TEdit *EditLoopCount;
   TLabel *Label30;
   TEdit *EditBusinessType;
   void __fastcall ButtonOkClick(TObject *Sender);
   void __fastcall PartGridSelectCell(TObject *Sender, int ACol, int ARow, bool &CanSelect);
   void __fastcall ButtonSkipClick(TObject *Sender);
   void __fastcall ButtonRestoreClick(TObject *Sender);
   void __fastcall ButtonViewLogClick(TObject *Sender);
   void __fastcall ButtonSortClick(TObject *Sender);
   void __fastcall ButtonRerunClick(TObject *Sender);
   void __fastcall ButtonStopClick(TObject *Sender);
   void __fastcall ButtonViewAdditionalLogClick(TObject *Sender);
   void __fastcall ButtonViewRestoreLogClick(TObject *Sender);

private:	// User declarations
   UTF8String __fastcall CurrentPartId();
   void __fastcall RefreshPartInfo();
   void __fastcall SortByColumn(int Index);

   static TNormalJobForm *This;
   static bool __fastcall Compare0(const HStageJob::HPartInfo *lhs, const HStageJob::HPartInfo *rhs);
   static bool __fastcall Compare1(const HStageJob::HPartInfo *lhs, const HStageJob::HPartInfo *rhs);
   static bool __fastcall Compare2(const HStageJob::HPartInfo *lhs, const HStageJob::HPartInfo *rhs);
   static bool __fastcall Compare3(const HStageJob::HPartInfo *lhs, const HStageJob::HPartInfo *rhs);
   static bool __fastcall Compare4(const HStageJob::HPartInfo *lhs, const HStageJob::HPartInfo *rhs);
   static bool __fastcall Compare5(const HStageJob::HPartInfo *lhs, const HStageJob::HPartInfo *rhs);
   static bool __fastcall Compare6(const HStageJob::HPartInfo *lhs, const HStageJob::HPartInfo *rhs);
   static bool __fastcall Compare7(const HStageJob::HPartInfo *lhs, const HStageJob::HPartInfo *rhs);

   bool OkFlag;
   HStageJob *FStage;
   HStageJob::HInfo Info;
   vector<HStageJob::HPartInfo*> PartVec;
public:		// User declarations
   __fastcall TNormalJobForm(TComponent* Owner);
   bool __fastcall Edit(HStageJob *Stage, bool PartFlag = false);
};
//---------------------------------------------------------------------------
extern PACKAGE TNormalJobForm *NormalJobForm;
//---------------------------------------------------------------------------
#endif
